﻿<UserControl x:Class="CustomerBrowser.Customer.GroupedCustomerView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <TabControl Grid.Row="1" ItemsSource="{Binding Path=Children}" SelectedItem="{Binding Path=SelectedChild}" IsSynchronizedWithCurrentItem="True" Margin="10">
        <TabControl.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Path=Title}" VerticalAlignment="Center" HorizontalAlignment="Left"/>

                    <Button  HorizontalAlignment="Right" FontFamily="Marlett" Content="r" FontSize="16"
                                    Margin="10,0,0,0" IsTabStop="False" ToolTip="Close"
                                    VerticalAlignment="Center" Command="{CBinding Path=CloseCommand}" />
                </StackPanel>
            </DataTemplate>
        </TabControl.ItemTemplate>
        <TabControl.ContentTemplate>
            <DataTemplate>
                <ViewContainer ViewModel="{Binding}" />
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>
</UserControl>
